using UnityEditor;

namespace DA.AnimGraph.Editor {

    [CustomEditor(typeof(AnimGraphArchiveAsset))]
    public class AnimGraphArchiveAssetEditor : UnityEditor.Editor {
        SerializedProperty uuidProperty;
        SerializedProperty graphUuidProperty;
        SerializedProperty resourcesProperty;
        SerializedProperty publishPathProperty;

        private void OnEnable() {
            uuidProperty = serializedObject.FindProperty("uuid");
            graphUuidProperty = serializedObject.FindProperty("graphUuid");
            resourcesProperty = serializedObject.FindProperty("resources");
            publishPathProperty = serializedObject.FindProperty("publishPath");
        }

        public override void OnInspectorGUI() {
            EditorGUI.BeginDisabledGroup(true); // 开始禁用
            EditorGUILayout.PropertyField(uuidProperty);
            EditorGUILayout.PropertyField(graphUuidProperty);
            EditorGUILayout.PropertyField(resourcesProperty);
            EditorGUI.EndDisabledGroup(); // 结束禁用
            EditorGUILayout.PropertyField(publishPathProperty);
            serializedObject.ApplyModifiedProperties();
        }
    }
}
